#include <stdio.h>
#include <time.h>
 
int main()
{
 time_t tt = time(0); //获取当前时间
 struct tm *pst = localtime(&tt); //把time_t类型转换为struct tm类型
 printf("The year is %d.\n", pst->tm_year + 1900); //别忘了要加1900
 
 return 0;
}
